#!usr/bin/env python
#coding=utf8

"""Model封装类
包含一些简便方法
model.update(**kwargs)
 => 
 set attr value
 save model
"""

class UtilModel(object):
    
    def update(self, **kwargs):
        """更新指定的字段"""
        for k, v in kwargs.iteritems():
            setattr(self, k, v)
        self.save(force_update=True)